define(['asset/core/ngRouter', 'angularAMD','bootstrap', 'ngLoader', 'ngConstant', 'ui-route', 'ui-bootstrap','angular-cookies','ng-file-upload'],
    function (router, angularAMD,bootstrap, ngLoader, ngConstant) {
        var app = angular.module("ngApp", ['ui.router', 'ui.bootstrap','ngCookies','ngFileUpload']);
        app.config(function ($stateProvider, $urlRouterProvider,$httpProvider) {
            //解决跨域问题
            $httpProvider.defaults.withCredentials = true;
            $httpProvider.defaults.headers.common = {'Access-Control-Allow-Origin': '*'};
            $httpProvider.crossDomain = true;
            if (router.routes) {
                angular.forEach(router.routes, function (route, path) {
                    $stateProvider.state(path, {
                        templateUrl: route.templateUrl,
                        url: route.url,
                        cache: false,
                        resolve: ngLoader(route.dependencies),
                        allowAnonymous: route.allowAnonymous
                    })
                });
                if (router.defaultRoute)
                    $urlRouterProvider.when("", router.defaultRoute);
            }
        });
        return angularAMD.bootstrap(app);
    })
;